var express = require('express');
var router = express.Router();
const house = require('../dao/house_dao')

/* GET users listing. */
router.get('/', function(req, res, next) {
    res.send('我是house');
});

/**
 * 房屋单元
 * req,res
 */

// 获取总列表
router.get('/gethouseList',function (req,res,next) {
    house.gethouseList(req,res)
});

//增加单元列表
router.post('/addunitList',function (req,res,next) {
    house.addunitList(req,res)
});

//单元编辑
router.post('/updateunitList',function (req,res,next) {
    house.updateunitList(req,res)
});

// 单元删除
router.get('/delunitList',function (req,res,next) {
    house.delunitList(req,res)
});

// 根据id获取信息
router.get('/getDetailId',function (req,res,next) {
    house.getDetailId(req,res)
});

//单元搜索
router.get('/searchList',function (req,res,next) {
    house.searchList(req,res)
});

/**
 * 房号管理
 * req,res
 */
// 房号编辑
router.post('/updatenumList',function (req,res,next) {
    house.updatenumList(req,res)
});
// 更新用户h_id
router.post('/updateUserHid',function (req,res,next) {
    house.updateUserHid(req,res)
});
//房号搜索
router.get('/searchnumList',function (req,res,next) {
    house.searchnumList(req,res)
});
// 批量删除
router.get('/delnumList',function (req,res,next) {
    house.delnumList(req,res)
});
router.get('/getHouseData',function (req,res,next) {
    house.getHouseData(req,res)
});


//改变智能设备状态
router.post('/updatesmartStatus',function (req,res,next) {
    house.updatehomeStatus(req,res)
});

//改变家居设备状态
router.post('/updatefamilyStatus',function (req,res,next) {
    house.updatefamilyStatus(req,res)
});
//设备搜索
router.get('/searchdeviceList',function (req,res,next) {
    house.searchdeviceList(req,res)
});




module.exports = router;
